package com.test.spring.demo9;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Component
//@Aspect
public class logAspect {
    /*@Pointcut("execution(* HelloService.add(..))")
    public void anyPer(){ }*/

    //@Before("")
    public void before(){
        System.out.println("before .. ");
    }
   /* @After("anyPer()")
    public void after(){
        System.out.println("after...");
    }
    @AfterReturning(value = "anyPer()",returning = "result")
    public void afterRunning(JoinPoint joinPoint,Object result){
        System.out.println(result);
    }

    @AfterThrowing(value = "anyPer()",throwing = "e")
    public void afterThrowing(JoinPoint joinPoint,Exception e){
        e.printStackTrace();
    }

    @Around(value = "anyPer()")
    public Object around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable{

        System.out.println("1");
        Object result=proceedingJoinPoint.proceed();
        System.out.println("2");
        return result;
    }
*/

}
